﻿@{
    ViewBag.Title = "教育经历";
}
@section header{

}
<div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    <div class="search-area">
        <div class="search-title">
            <i class="glyphicon glyphicon-th fl" style="margin-left:10px;margin-right:5px;line-height:26px;margin-top:-1px;"></i><span class="fl">查询区</span>
            <i class="glyphicon glyphicon-chevron-up fr" id="requireHide" style="margin-right:15px;margin-left:30px;width:26px;height:26px;cursor:pointer;text-align:center;line-height:26px;"></i>
            <div class="fr" style="line-height:24px;">
                <a class="btn btn-primary dropdown-text" id="btn_search" style="border:1px solid #ddd;"><i class="glyphicon glyphicon-search"></i>查询</a>
                <a class="btn btn-primary dropdown-text" id="chongz" style="border:1px solid #ddd;"><i class="glyphicon glyphicon-refresh"></i>重置</a>
            </div>
        </div>
        <div class="search-require">
            <div class="container-fluid">
                <div class="row" style="width:100%;margin:0;">
                    <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                        <span class="fl">关键字:&nbsp;&nbsp;</span>
                        <span class="fl">
                            <input id="Name" name="Name" type="text" autocomplete="off" />
                        </span>
                    </div>

                </div>
            </div>
        </div>
    </div>
    <div class="content-zl">
        <div class="content-title">
            <i class="glyphicon glyphicon-th fl" style="margin-left:10px;margin-right:5px;line-height:26px;margin-top:-1px;"></i><span class="fl">列表区</span>
        </div>
        <div class="btn-area">
            <div class="toolbar">
                <div class="fl">
                    <select id="selsearch" name="selsearch">
                        <option value="">==请选择查询方案==</option>
                    </select>
                    <a class="btn btn-primary" onclick="btn_divsearch()"><i class="glyphicon glyphicon-search"></i>&nbsp;查询</a>
                </div>
                <div class="fr">
                    <a id="NF-add" authorize="yes" class="btn btn-primary" onclick="btn_add()"><i class="glyphicon glyphicon-plus"></i>&nbsp;新增</a>
                    <a id="NF-edit" authorize="yes" class="btn btn-primary" onclick="btn_edit()"><i class="glyphicon glyphicon-pencil"></i>&nbsp;修改</a>
                    <a id="NF-delete" authorize="yes" class="btn btn-primary" onclick="btn_delete()"><i class="glyphicon glyphicon-minus"></i>&nbsp;删除</a>
                    <a id="NF-import" authorize="yes" class="btn btn-primary" onclick="btn_import()"><i class="glyphicon glyphicon-open"></i>&nbsp;导入</a>
                    <a id="NF-export" authorize="yes" class="btn btn-primary" onclick="btn_export()"><i class="glyphicon glyphicon-save"></i>&nbsp;导出</a>
                </div>
                <script>$('.toolbar').authorizeButton()</script>
            </div>
        </div>
        <div class="gridPanel" style="width:100%;">
            <table id="gridList" style="width:100%;height:1px"></table>
            <div id="gridPager" style="width:100%"></div>
        </div>
    </div>
</div>

@section scripts{
    <script>
        var baseUrl = "/Personnel/EducationResume/";
        $(function () {
            seachHeight();//查询区域高度
            gridList();
        })
        function gridList() {
            var $gridList = $("#gridList");
            $gridList.dataGrid({
                url: baseUrl + "GetJGridPageDataJson",
                datatype: "json",
                height: $(window).height() - 128,
                mtype: "POST",
                colModel: [
                    { label: "主键", name: "ID", hidden: true, key: true },
                    { label: '开始时间', name: 'BeginDate', align: 'left' },
                    { label: '结束时间', name: 'EndhDate', align: 'left' },
                    { label: '学校', name: 'School', align: 'left' },
                    { label: '学制', name: 'Educational', align: 'left' },
                    { label: '专业', name: 'Specialty', align: 'left' },
                    { label: '学缘', name: 'Content', align: 'left' },
                    { label: '经历', name: 'Experience', align: 'left' },
                    { label: '学位', name: 'Degree', align: 'left' },
                    { label: '学历形式', name: 'DegreeForm', align: 'left' },
                    { label: '学历归属', name: 'ExperienceBT', align: 'left' },
                    { label: '隶属学科', name: 'TheirDiscipline', align: 'left' },
                    { label: '指导教师', name: 'GuideTeacher', align: 'left' },
                    { label: '添加时间', name: 'AddTime', align: 'left' }
                ],
                rowNum: 20,
                rowList: [20, 50, 100],
                pager: '#gridPager',
                sortname: 'OrderBy',
                sortorder: "asc",
                viewrecords: true,
                autowidth: true,
                multiselect: true,
                loadComplete: function () {
                    $('.ui-jqgrid-bdiv').scrollTop(0);
                    setTimeout(function () { btn_tc(); });
                }
            });
            $gridList.jqGrid('setFrozenColumns');
            $("#btn_search").click(function () {
                $gridList.jqGrid('setGridParam', {
                    postData: { keyword: $("#txt_keyword").val() },
                }).trigger('reloadGrid');
            });
        }
        function btn_add() {
            $.modalOpen({
                id: "Form",
                title: "新增",
                url: baseUrl + "Form",
                width: "700px",
                height: "440px",
                callBack: function (iframeId) {
                    top.frames[iframeId].submitForm();
                }
            });
        }
        function btn_edit() {
            var keyValue = $("#gridList").jqGridRowValue().ID;
            $.modalOpen({
                id: "Form",
                title: "修改",
                url: baseUrl + "Form?keyValue=" + keyValue,
                width: "700px",
                height: "440px",
                callBack: function (iframeId) {
                    top.frames[iframeId].submitForm();
                }
            });
        }
        function btn_delete() {
            $.deleteForm({
                url: baseUrl + "DeleteForm",
                param: { keyValue: $("#gridList").jqGridRowValue().ID },
                success: function () {
                    $.currentWindow().$("#gridList").resetSelection();
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            })
        }
        function btn_details() {
            var keyValue = $("#gridList").jqGridRowValue().ID;
            $.modalOpen({
                id: "Details",
                title: "查看",
                url: baseUrl + "Details?keyValue=" + keyValue,
                width: "700px",
                height: "490px",
                btn: null,
            });
        }
        function btn_divsearch() {
            $.modalOpen({
                id: "divsearch",
                title: "查询方案",
                url: "/Sys/DivSearch/Index",
                width: "700px",
                height: "440px",
                callBack: function (iframeId) {
                    top.frames[iframeId].submitForm();
                }
            });
        }
    </script>
}